package com.snow.storeapi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.storeapi.entity.PatientInfo;
import com.snow.storeapi.mapper.PatientInfoMapper;
import com.snow.storeapi.service.IPatientInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PatientInfoServiceImpl extends ServiceImpl<PatientInfoMapper, PatientInfo> implements IPatientInfoService {
    @Autowired
    private PatientInfoMapper patientInfoMapper;

    public PatientInfo selectByRecordId(String recordId) {
        PatientInfo patientInfo = patientInfoMapper.selectByRecordId(recordId);
        return patientInfo;
    }

    @Override
    public List<PatientInfo> selectAllPatients() {
        List<PatientInfo> patientInfos = patientInfoMapper.selectAllPatients();
        return patientInfos;
    }

    @Override
    public List<PatientInfo> dailyPatients(String visitDate) {
        List<PatientInfo> patientInfos = patientInfoMapper.dailyPatients(visitDate);
        return patientInfos;
    }

    @Override
    public List<Map<String, Object>> sexRate(String visitDate) {
        List<Map<String, Object>> data = patientInfoMapper.sexRate(visitDate);
        return data;
    }
}
